home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / PDraw3.0.adf / pdraw_rex.lzh / CopyPages.pdrx < prev    next >
Text File  |  1992-06-15  |  1KB  |  46 lines

  1. /*
  2. @N
  3.  
  4. This Genie makes any number of copies of a range of pages.
  5. */
  6. cr = '0a'x
  7. last = pdm_DocLastPage()
  8. first = pdm_DocFirstPage()
  9. cpage = pdm_CurrentPage()
  10. if cpage = 0 then exit_msg("Please create a page before running this Genie.")
  11.  
  12. form = "From:"first'0a'x"To:"last'0a'x"Num copies:"1
  13. form = pdm_GetForm("Enter Range Of Pages", 5, form)
  14. if form = '' then call exit_msg()
  15. parse var form from '0a'x topage '0a'x numcopies
  16.  
  17. if ~(datatype(from, n) & datatype(topage, n) & datatype(numcopies, n)) then
  18.     exit_msg('Invalid Input')
  19.  
  20. if from < first | from > last | topage < first | topage > last then
  21.     exit_msg('Invalid Input')
  22.  
  23. call pdm_AutoUpdate(0)
  24.  
  25. endpage = topage + 1
  26.  
  27. do n = 1 to numcopies
  28.     do i = from to topage
  29.         call pdm_CopyPage(i, endpage, 1)
  30.         endpage = endpage + 1
  31.     end
  32. end
  33.  
  34. exit_msg("Done")
  35.  
  36. exit_msg: procedure expose cpage
  37. do
  38.    parse arg message
  39.  
  40.     if message ~= '' then call pdm_Inform(1, message,)
  41.     if cpage ~= 0 then call pdm_GotoPage(cpage)
  42.     call pdm_AutoUpdate(1)
  43.     exit
  44. end
  45.  
  46.